<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>管理员登录</title>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../lib/html5shiv.js"></script>
    <script type="text/javascript" src="../lib/respond.min.js"></script>
    <![endif]-->
    <link href="../static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="../static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css"/>
    <link href="../static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="../lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css"/>

</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value=""/>
<div class="header"></div>
<div class="loginWraper">
    <div id="loginform" class="loginBox">
        <form class="form form-horizontal" action="<%=request.getContextPath()%>/AdminLoginServlet" method="post">
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-8">
                    <input id="adminname" name="adminname" type="text" placeholder="账户" class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-8">
                    <input id="adminpwd" name="adminpwd" type="password" placeholder="密码" class="input-text size-L">
                </div>
            </div>
            <%-- 验证码--%>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <input class="input-text size-L" type="text" id="checkCode" name="checkCode" placeholder="验证码" style="width:150px;"
                           onblur="checkCodeJS()">
                    <img id="piccode" src="<%=request.getContextPath()%>/ImageServlet"><a href="javascript:reloadCode();">换一个</a><br/>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <label for="online">
                        <input type="checkbox" name="online" id="online" value="1">
                        使我保持登录状态</label>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <input name="" type="submit" class="btn btn-success radius size-L"
                           value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
                    <input name="" type="reset" class="btn btn-default radius size-L"
                           value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
                </div>
            </div>
         </div>
      </form>
    </div>
</div>
<div class="footer">Copyright 河南云和数据信息技术有限公司 by H-ui.admin v3.1</div>
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script type="text/javascript">
    $(function () {
        /* 检测cookie*/
        $("#username").blur(function () {
            var username = $(this).val();
            var pwd = $.cookie(username);
            $("#pwd").val(pwd);
            $("#ckBox").attr("checked", true);
        });
    });
    function reloadCode(){
        var date=new Date().getTime();
        document.getElementById("piccode").src="<%=request.getContextPath()%>/ImageServlet?d="+date;
    }
    function checkCodeJS() {
        /*判断验证码是否正确*/
        $("#checkCode").blur(function (){
            var checkCode = $("#checkCode").val();
            var code = $("#piccode").val();
            if (checkCode != code) {
                $("#DivCheckCode").text("验证码错误").css("color", "red");
                $(":submit").attr("disabled", "disabled");
            } else {
                $(":submit").attr("disabled", false);
            }
        });
    }
</script>


</body>
</html>
